import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
const routers = new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: () => import('@/components/HelloFromVux')
    },
    {
      path: '/auth',
      name: 'auth',
      component: () => import('@/pages/auth')
    },
    {
      path: '/card',
      name: 'card',
      component: () => import('@/pages/auth/card')
    },
    {
      path: '/protocol',
      name: 'protocol',
      component: () => import('@/pages/auth/protocol')
    }
  ]
});

routers.beforeEach((to, from, next) => {
  // 这里做路由拦截
  next();
});

export default routers;
